<template>
  <el-link class="jira-number-link"
           v-if="jiraNumber"
           :href="goToJiraURL"
           :underline="false"
           target="_blank">
    <i class="cuifont icon_arrow_refresh_to"></i>
  </el-link>
</template>

<script>
export default {
  name: 'JiraNumberLink',
  props: {
    jiraNumber: {
      type: [String, Number]
    }
  },
  data () {
    return {}
  },
  computed: {
    goToJiraURL () {
      let tempData = this.jiraNumber
      if (tempData) {
        if (tempData.indexOf('http') === -1) {
          return 'https://jira.mspbots.ai/browse/' + tempData
        }
        return tempData
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.jira-number-link {
  color: #c0c4cc;
  text-decoration: none;
  width: 25px;
  .cuifont {
    font-size: 12px;
  }
}
</style>
